$(document).ready(function(){
	/**
	 * 查询资金明细数据
	 */
	var queryAccountLog = new Helper.RemoteTrans({
		url: Helper.basePath + "/member_operate/userAccountDetail.htm",
		isAsync : false,
		onSuccess: function(result) {
			$("#IcurrentPage").val(result.returnObject);
			var resultList = result.returnValue;
			if(result.returnValue==''||result.returnValue==null||result.returnValue.length<5){
				$('#querymore').hide();
			}
			
			for ( var i = 0; i < resultList.length; i++) {
				var alog = resultList[i];
				var tradeMode;
				if(alog.tradeMode=="ADD"){
					tradeMode="+";
				}else if(alog.tradeMode=="SUBTRACT"){
					tradeMode="-";
				}
				// <a href="#" class="blue">查看</a>
				if($("#3338login").val()==3338){
					$('#accountLogList_tbody').append(' <section><a  href="javascript:void(0);"><detail><ul><li class="title_jl"><b>交易时间：</b><span>'+alog.transTimeText+'</span></li><li class="title_jl"><b>交易类型：</b><span>'+ alog.transTypeText +'</span></li></td><td> <li class="title_jl"><b>交易金额：</b><span style="color:red">'+tradeMode+alog.transMoney+'</span></li></ul></detail></a> </section>');
				}else{
					$('#accountLogList_tbody').append('<tr><td>'+alog.transTypeText+'<p class="ui_color_gray ui_font_S">'+ alog.transTimeText +'</p></td><td><span style="color:red">'+tradeMode+alog.transMoney+'</span></td><td>'+alog.transTypeText+'<p></p></td></tr>');
				}
			}
		}
	});
	queryAccountLog.addParameters("currentPages", ($("#IcurrentPage").val()*1));
	queryAccountLog.addParameters("pageSizes", 5);
	queryAccountLog.send();
	
	new Helper.RemoteTrans({
		url: Helper.basePath + "/memberCenter/member_operate/getWithdraw.htm",
		isAsync : false,
		onSuccess: function(result) {
			var resultValue = result.returnValue;
			$('#mylottery_transInfo_ktx').html(resultValue['canMoney']+'元');
			$('#noCanMoney').html(resultValue['noCanMoney']+'元');
		}
	}).send();
	
	/**
	 * 查看更多
	 */
	$('#querymore').click(function (){
		queryAccountLog.addParameters("currentPages", ($("#IcurrentPage").val()*1)+1);
		queryAccountLog.addParameters("pageSizes", 5);
		queryAccountLog.send();
	});
	
	/**
	 * 刷新操作
	 */
	window.onbeforeunload=function (){
		queryAccountLog.addParameters("currentPages", 1);
		queryAccountLog.addParameters("pageSizes", 5);
		queryAccountLog.send();
	};
});